package com.example.myblog1_0.mapper;

import com.example.myblog1_0.model.Categories;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: xc
 * @Date: 2018/12/16 20:58
 * @Description:
 **/
@Mapper
@Repository
public interface CategoriesMapper {
    /**
     * 返回文章分类名称
     * @return
     */
    @Select("select categoryName from categories")
    List<String> findCategoriesName();
    /**
     * 根据分类名称获得分类个数
     * @param CategoryName
     * @return
     */
    @Select("select count(*) from article where articleCategories = #{CategoryName}")
    int getArticleNumByName(String CategoryName);
}
